Plugin Manager - Installer Help - Using Custom Object in Scripts


 

Using Custom Ships:

Using custom ships in your scripts is a little different than you would normally make use of ships, the reason for this is that normally, ship objects are saved as thier id position, but because the plugin manager installs ships in different places, thier ID's will be different. This means that scripts built for one game wouldn't work in someone else game as the ship could be in a different place.

Luckliy the Plugin Manager has a set of scripts included that can get the correct ID for the ship no matter where its installed, to do this, you need to use the script "plugin.plugman.getship".

Get Ship

You just call the script with the correct Ship id, and it will return the correct shiptype. If the ship is not installed or is disabled, it will return NULL. So you should always test if the return is NULL before using it.

 

Using Custom Wares:

Wares work exactly the same as ships, but instead, you just use the "plugin.plugman.getware" script instead.